<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});
Route::resource('stu','StuController');
//多重路由
/*
Route::match(['get','post'],'/aa', function () {
    return "hello 可接收git和post";
});
Route::get('/test',"Mytest\TestController@index");
//路由参数
Route::get('/test/{id?}', function ($id=null) {
    return 'hello test'.$id;
})->where("id","[0-9]+");
//路由命名
Route::get('/bb', ['as'=>"mybb",function () {
abort(404);
	echo "当前请求".route("mybb")."<br/>";
    return "hello bb";
}]);

Route::get('/demo',"DemoController@index");
Route::get('/test/add',"Mytest\TestController@add");
Route::get('/test/del/{id?}',"Mytest\TestController@del");



Route::get('/stu',"StuController@index");
Route::post('/hello', function () {
    return 'hello POSt';
});
Route::put('/hello', function () {
    return 'hello put';
});
Route::delete('/hello', function () {
    return 'hello delete';
});
*/